package com.wms.oms.enums;

import com.baomidou.mybatisplus.annotation.IEnum;

/**
 * @author zzm
 * @desc 审批状态
 */

public enum ApprovalStatus implements IEnum<String> {
    /**
     * 待提交
     */
    WAIT_COMMIT("待提交", "0"),

    /**
     * 待审批
     */
    APPROVALING("待审批", "1"),

    /**
     * 已审批
     */
    APPROVALED("已审批", "2");

    private String name;
    private String value;

    ApprovalStatus(String name, String value) {
        this.name  = name;
        this.value = value;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    public String getName() {
        return this.name;
    }

    public static ApprovalStatus parse(Integer value) {
        for (ApprovalStatus inventoryStatus : values()) {
            if (inventoryStatus.getValue().equals(value)) {
                return inventoryStatus;
            }
        }
        return null;
    }
}
